1. Field of the Invention
The present invention relates to elliptic curve arithmetic.
2. Description of the Prior Art
Cryptography is an important tool for information security. Authenticated key establishment is a necessary ingredient for secure use of cryptography. Public key cryptography is a powerful tool for authenticated key establishment. Two families of public key cryptography techniques are the Rivest-Shamir-Adleman (RSA) techniques, the Diffie-Hellman (DH) techniques and the related ElGamal discrete logarithm (DL) techniques. Elliptic curve cryptography (ECC) is a member of the latter family using elliptic curve arithmetic as opposed to the modular integer arithmetic. The advantages of ECC are many.
An elliptic-curve point is a pair (x,y) of values x and y that belong to a finite field. An elliptic curve E is a set of such points defined by an equation plus one further point, called the point at infinity and denoted by O. When the finite field is a prime field Fp then the equation is of the form y2=x3+ax+b for some elements a and b in the field. When the finite field is a binary field F2^m then the equation is of the form y2+xy=x3+ax2+b. The values a and b are called the coefficients of the equation. The notation Ea,b distinguishes the values of the coefficients a and b, if need be. Points can be added using formulae involving the components. A point can be multiplied by an integer k to obtain another point kP=P+P+ . . . +P, where there are k points in the sum. A point G and an integer n are distinguished such that nG=O. The distinguished point G is called the generating point and n is called the order of the point G. An elliptic-curve public-key P is of the form P=vG where v is the associated private key. Numerous standards specify curves and their distinguished points such that their order n is prime.
The ECIES protocol is specified in the standard ANSI X9.63-2001 [X9.63, Section 5.8] and is summarised here for completeness. In this protocol a sender wishes to encrypt a message to a recipient. The recipient's long term keypair is (v,Q), where Q=vG. The sender generates an ephemeral elliptic-curve key-pair (e,P), where P=eG, and generates two symmetric-encryption keys, K1 and K2, from the product eQ via the use of a key-derivation function as described in the standard. The first symmetric key is used to encrypt the message and the second symmetric key is used to generate a keyed hash of the encrypted message. The ephemeral public key P, the encrypted message, and the keyed hash are transmitted to the recipient. The above standard also provides methods of key agreement, key transport, encryption, and authentication.
The recipient validates the purported ephemeral public key P and then recovers the two symmetric-encryption keys from the product vP via the use of the key-derivation function as described in the standard. The second symmetric key is used to verify the keyed hash and the first symmetric key is used to recover the message.
In a prior patent application PCT CA98/100959, the assignees of the present application recognised that an important security safeguard for all forms of public-key cryptography is public-key validation. Public-key validation comprises confirming that what purports to be a public key is, in reality, a public key by ensuring that is satisfies a number of predefined criteria. A good security principle is to always validate a purported public key before use. If the purported public key is invalid then performing any operations with it may jeopordize security.
Elliptic-curve public key validation involves the following four steps:    1. Verify that the public key is not O;    2. Verify that the co-ordinates x and y of the public key P=(x,y) are valid elements of the field;    3. Verify that P is on the curve, which can be done by testing the defining equation; and    4. Verify that nP=O.
If public-key validation is not performed for every purported public key received then there is the risk that the public key is not valid and processing it will adversely affect the security of the system. In particular, the third step above, checking that P=(x,y) is on the curve, is important because of possible attacks. Processing a public key P invariably involves multiplication by some secret integer v that acts as the long term private key. The secrecy of v is vital to the security of the system. The quantity vP is computed and then used subsequently as the long term public key. The intractability of recovery from the vP is the basis of public key cryptography. If P has undesirable characteristics then information can leak from the computation about private data, such as private keys. In particular, this is true using a unsafe variant of ECIES with non-validated public keys, as will be explained more fully below.
In a recently proposed protocol, an unsafe variant of ECIES was advocated wherein the step of validating the public key at the recipient is omitted. The lack of validation opens the recipient to the attack described below that can be carried out by anyone who wishes to discover the private key of the recipient.
The attack is based on the observation that, although an elliptic curve Ea,b is defined in terms of its coefficients a and b, the usual formulae defining addition and doubling in elliptic curves do not involve the coefficient b. Thus the same elliptic-curve addition and doubling formulae for Ea,b will also work for another curve Ea,b′ with b′≠b. If an attacker chooses a point P that belongs not on the curve Ea,b but rather on another curve Ea,b′ that possesses undesirable characteristics, calculations involving P do not take place in the former curve but rather in the latter curve. If the recipient does not validate P as belonging to Ea,b as set forth in the above referenced prior application then calculations involving P will leak information.
In one attack, the sender who wishes to attack the security of v forces a zero-division at the recipient by ajudicious choice of the transmitted ephemeral point P. This variant assumes that the recipient's behaviour on zero-division can be detected by the attacker. (For example, if a zero-division causes a fault or exception or some such behaviour that can be detected and distinguished as such.) Information can then leak out.
By way of example, with a prime curve, the attacker sends the point P=(x,0) and the recipient calculates 2P as part of the decryption process of multiplying P with the private key. The use of the usual affine formula causes some sort of detectable behaviour because the usual formula involves dividing by zero. The attacker now knows that the corresponding bit of the private key is zero. More bits can now be extracted by sending points that cause zero-division with specific multiplications kP. (Finding such points involves solving polynomial equations over the underlying finite-field which may be done relatively efficiently.)
In an alternative attack, the attacker discovers the factors of the private key by forcing the recipient to calculate in another elliptic curve of lower order and then combines said factors to recreate the private key.
To perform this attack, the attacker first finds a point P and an elliptic curve E′ such that the former generates a low-order subgroup in the latter, say of order r so that rP=O in E′. Next, ajudicious guess is made of an integer t such that tP=vP in E′, where v is the recipient's private key. Having this, the attacker can create an ECIES message based on E′. If t and v are congruent modulo the order of the low-order subgroup, the validation of the keyed hash succeeds. The success of the keyed hash informs the attacker that the private key equals t modulo r. The attacker then repeats the process with different points and curves, eventually combining all the modular pieces using the Chinese Remainder Theorem (CRT).
This attack may be applied for example to the NIST-recommended curve P-192 that is defined over a prime field Fp, where p is close to 2192. This curve has prime order, also close to 2192. To launch the attack, first find 36 points that belong to curves with b coefficients different from P-192 but with the same a coefficient and whose orders are the first 36 prime numbers: 2, 3, 5, . . . , 151. (It is possible to find such points by selecting random coefficients b, counting the number of points on the associate curve by the Schoof-Elkies-Atkin algorithm, checking the order of the curve for divisibility by one of the first 36 primes, and finding points on the curve of each of such prime order by multiplying random points on the curve by the order of the curve divided the prime divisor.) Once the 36 points are collected, they can be used to find a victim's private key modulo 2, 3, . . . , 151. Each prime requires half its value in guess attempts by the attack. On average, the attacker requires the victim to confirm about (2+3+ . . . +151)/2 guesses, or about 1214 guesses. If the recipient is an automated server, this is completely plausible. For curves of larger order, more guesses are required while for curves of smaller order, fewer guesses are required.
In general, it is not necessary that such a large number of guesses be confirmed by the recipient. Harm can be done even if one guess is confirmed, since information is then leaked about the recipient's private key. Even if the attacker's guess of t for a given modulus r is incorrect, the attacker still learns that the recipient's private key does not equal t modulo r, so that information is leaked. A limited set of confirmed guesses is considerably worse than merely what the theoretical information leakage would suggest because of the following practical means of exploiting partial information leaked about the private key.
Suppose that the private key v is between 1 and n−1. Suppose further that the attacker learns d modulo rj for k small and relatively-prime numbers rj, . . . , rk but m=r1r2 . . . rk<n. In this case the attacker can use the Chinese remainder theorem (CRT) to compute n completely. The attacker uses CRT to compute that d=x (mod m) where x is between 0 and m−1. The attacker can thus deduce that d=x+ym for some y between 1 and (n−1)/n. Now the attacker can speed up the usual Pollard rho and kangaroo methods to find d as follows. The attacker has the public key Q=vG, a valid point on the curve. The attacker computes (1/m mod n)(Q−xG) which the attacker knows to be equal to yG. Since the attackers know that y belongs a smaller range [1,(n−1)/m] than the general range [1,n−1], the attacker can speed up the Pollard rho algorithm by well-known techniques.